package daniel.suen.physics2d;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.util.Iterator;
import java.util.Set;

import javax.swing.JPanel;

import daniel.suen.physics2d.shape.Obj;

public class DrawPanel extends JPanel{
	Env env;
	
	Obj obj;
	
	Set<Object> keySet;
	
	public DrawPanel(){
		
	}
	
	@Override
	public void paint(Graphics g) {
		super.paint(g);
		Graphics2D g2 = (Graphics2D)g;
		
		keySet = env.getObjMap().keySet();
		for(Object key:keySet ){
			obj = env.getObjMap().get(key);
			g2.draw(obj.getShape().getData());
		}
	}

	public Env getEnv() {
		return env;
	}

	public void setEnv(Env env) {
		this.env = env;
	}

}
